﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wicresoft.UnifyShow.Business;


namespace Wicresoft.UnifyShow.BusinessImplMock
{
    public class MockBusinessAvailability : IBusinessAvailability
    {   
        List<BusinessAvailabilityModel> avas = new List<BusinessAvailabilityModel>(){
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.9,Timestamp=new DateTime(2012,7,10)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.95,Timestamp=new DateTime(2012,7,11)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.86,Timestamp=new DateTime(2012,7,12)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.8,Timestamp=new DateTime(2012,7,13)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.9,Timestamp=new DateTime(2012,7,14)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.95,Timestamp=new DateTime(2012,7,15)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.86,Timestamp=new DateTime(2012,7,16)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 1,BusinessName="资金结算系统",SiteName="省局",Availability=0.8,Timestamp=new DateTime(2012,7,17)},

            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.7,Timestamp=new DateTime(2012,7,10)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.75,Timestamp=new DateTime(2012,7,11)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.86,Timestamp=new DateTime(2012,7,12)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.5,Timestamp=new DateTime(2012,7,13)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.9,Timestamp=new DateTime(2012,7,14)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.95,Timestamp=new DateTime(2012,7,15)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.86,Timestamp=new DateTime(2012,7,16)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 2,BusinessName="资金结算系统",SiteName="三明",Availability=0.8,Timestamp=new DateTime(2012,7,17)},

            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.9,Timestamp=new DateTime(2012,7,10)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.9,Timestamp=new DateTime(2012,7,11)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.9,Timestamp=new DateTime(2012,7,12)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.8,Timestamp=new DateTime(2012,7,13)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.9,Timestamp=new DateTime(2012,7,14)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.95,Timestamp=new DateTime(2012,7,15)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.86,Timestamp=new DateTime(2012,7,16)},
            new BusinessAvailabilityModel{BusinessID = 1,SiteID = 3,BusinessName="资金结算系统",SiteName="厦门",Availability=0.8,Timestamp=new DateTime(2012,7,17)}
        };
        public MockBusinessAvailability()
        {

 
        }

        public List<BusinessAvailabilityModel> GetBusinessAvailability(string BID, string Site, DateTime st, DateTime et)
        {
            return avas.Where(b => (b.Timestamp >= st || b.Timestamp <= et) && b.SiteID == int.Parse(Site) && b.BusinessID == int.Parse(BID))
                .ToList();
        }

        public List<BusinessAvailabilityModel> GetBusinessAvailability(string BID, DateTime st, DateTime et)
        {
            return avas.Where(b => (b.Timestamp >= st || b.Timestamp <= et) && b.BusinessID == int.Parse(BID))
                .ToList();
        }
    }


}
